﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace MySkiPatrolEntity
{
    [ServiceContract]
    public interface IAdmin
    {
        [OperationContract]
        string Version();

        [OperationContract]
        Patrols GetPatrolList();

        [OperationContract]
        Patrol GetPatrol(Patrol data);

        [OperationContract]
        Patrol PutPatrol(Patrol data);

        [OperationContract]
        Patrol GetMembers(Patrol data);

        [OperationContract]
        Member GetMember(Member data);

        [OperationContract]
        Member PutMember(Member data);

        [OperationContract]
        IDCard PutIDCard(IDCard data);
    }

    [DataContract]
    public class AppSetting
    {
        [DataMember]
        public DataTransaction DataTransaction { get; set; }

        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string Value { get; set; }
    }

    [DataContract]
    public class Patrol
    {
        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string Title { get; set; }
        [DataMember]
        public string dbPrefix { get; set; }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string SubDomain { get; set; }
        [DataMember]
        public List<AppSetting> ApplicationSettings { get; set; }
        [DataMember]
        public WeatherForecast WeatherForecast { get; set; }

        [DataMember]
        public List<Member> MemberBulkLoad { get; set; }

        [DataMember]
        public List<Member> Members { get; set; }

        [DataMember]
        public DataTransaction DataTransaction { get; set; }
    }

    [DataContract]
    public class Patrols
    {
        [DataMember]
        public List<Patrol> PatrolList { get; set; }

        [DataMember]
        public DataTransaction DataTransaction { get; set; }
    }

    [DataContract]
    public class WeatherForecast
    {
        private string _id = string.Empty;
        private string _name = string.Empty;
        private string _location = string.Empty;
        private string _dayCount = string.Empty;
        private string _data = string.Empty;
        private string _html = string.Empty;
        private string _refreshInterval = string.Empty;
        private DateTime _lastUpdate;


        [DataMember]
        public string ID
        {
            get { return _id; }
            set { _id = value; }
        }

        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [DataMember]
        public string Location
        {
            get { return _location; }
            set { _location = value; }
        }

        [DataMember]
        public string DayCount
        {
            get { return _dayCount; }
            set { _dayCount = value; }
        }

        [DataMember]
        public string Data
        {
            get { return _data; }
            set { _data = value; }
        }

        [DataMember]
        public string HTML
        {
            get { return _html; }
            set { _html = value; }
        }

        [DataMember]
        public string RefreshInterval
        {
            get { return _refreshInterval; }
            set { _refreshInterval = value; }
        }

        [DataMember]
        public DateTime LastUpdate
        {
            get { return _lastUpdate; }
            set { _lastUpdate = value; }
        }
    }
}
